<p class="Head1"><help:paragraphinfo state="U" number="1" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="numbers; format codes" tag="kw65744_1" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="format codes; numbers" tag="kw65744_18" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="codes; number format codes" tag="kw65744_17" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="conditions; in number formats" tag="kw65744_16" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="number format codes; overview" tag="kw65744_15" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="zahlenformatcodes" xmlns:help="http://openoffice.org/2000/help"><help:link Id="65744">Number Format Codes</help:link></help:to-be-embedded></p>
<p class="Paragraph"><help:paragraphinfo state="U" number="88" xmlns:help="http://openoffice.org/2000/help"/>Number format codes can consist of up to three sections separated by a semicolon (;).</p>
<ul class="L1">
<li class="">
<p class="P2"><help:paragraphinfo state="U" number="108" xmlns:help="http://openoffice.org/2000/help"/>In a number format code with two sections, the first section applies to positive values and zero, and the second section applies to negative values.</p>
</li>
<li class="">
<p class="P2"><help:paragraphinfo state="U" number="109" xmlns:help="http://openoffice.org/2000/help"/>If a number format code with three sections, the first section applies to positive values, the second section to negative values, and the third section to the value zero.</p>
</li>
</ul>
<ul class="L2">
<li class="">
<p class="P3"><help:paragraphinfo state="U" number="110" xmlns:help="http://openoffice.org/2000/help"/>You can also assign conditions to the three sections, so that the format is only applied if a condition is met.</p>
</li>
</ul>
<p class="Head2"><help:paragraphinfo state="U" number="229" xmlns:help="http://openoffice.org/2000/help"/>Decimal Places and Significant Digits</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="3" xmlns:help="http://openoffice.org/2000/help"/>Use zero (0) or the number sign (#) as placeholders in your number format code to represent numbers. The (#) only displays significant digits, while the (0) displays zeroes if there are fewer digits in the number than in the number format.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="107" xmlns:help="http://openoffice.org/2000/help"/>Use question marks (?) to represent the number of digits to include in the numerator and the denominator of a fraction. Fractions that do not fit the pattern that you define are displayed as floating point numbers.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="4" xmlns:help="http://openoffice.org/2000/help"/>If a number contains more digits to the right of the decimal delimiter than there are placeholders in the format, the number is rounded accordingly. If a number contains more digits to the left of the decimal delimiter than there are placeholders in the format, the entire number is displayed. Use the following list as a guide for using placeholders when you create a number format code:</p>
<p class="TextInTable"><help:paragraphinfo state="U" number="8" xmlns:help="http://openoffice.org/2000/help"/>Displays extra zeros if the number has less places than zeros in the format.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="21" xmlns:help="http://openoffice.org/2000/help"/>Depending on your language setting, you can use a comma or a period as a thousands separator. You can also use the separator to reduce the size of the number that is displayed by a multiple of 1000.</p>
<p class="Head2"><help:paragraphinfo state="U" number="79" xmlns:help="http://openoffice.org/2000/help"/>Including Text in Number Format Codes</p>
<p class="Head3"><help:paragraphinfo state="U" number="231" xmlns:help="http://openoffice.org/2000/help"/>Text and Numbers</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="80" xmlns:help="http://openoffice.org/2000/help"/>To include text in a number format that is applied to a cell containing numbers, place a double quotation mark (") in front of and behind the text, or a backslash (\) before a single character. For example, enter <span class="T1">#.# "meters"</span> to display "3.5 meters" or <span class="T1">#.# \m</span> to display "3.5 m".</p>
<p class="Head3"><help:paragraphinfo state="U" number="232" xmlns:help="http://openoffice.org/2000/help"/>Text and Text</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="82" xmlns:help="http://openoffice.org/2000/help"/>To include text in a number format that is applied to a cell that might contain text, enclose the text by double quotation marks (" "), and then add an at sign (@). For example, enter <span class="T1">"Total for "@</span> to display "Total for December".</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="81" xmlns:help="http://openoffice.org/2000/help"/>To use a character to define the width of a <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>space in a number format, type an underscore ( _ ) followed by the character. The width of the space varies according to the width of the character that you choose. For example, <span class="T1">_M</span> creates a wider space than <span class="T1">_i</span>.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="28" xmlns:help="http://openoffice.org/2000/help"/>To set the color of a section of a number format code, insert one of the following color names in square brackets []:</p>
<p class="Head2"><help:paragraphinfo state="U" number="111" xmlns:help="http://openoffice.org/2000/help"/><a name="einbeispiel"/><help:key-word value="number format codes; with conditions" tag="kw65744_14" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="conditions; for number format codes" tag="kw65744_13" xmlns:help="http://openoffice.org/2000/help"/>Conditions</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="112" xmlns:help="http://openoffice.org/2000/help"/>You can define a number format so that it only applies when the condition that you specify is met. Conditions are enclosed by square brackets [ ].</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="115" xmlns:help="http://openoffice.org/2000/help"/>You can use any combination of numbers and the <, <=, >, >=, = and <> <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>operators.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="236" xmlns:help="http://openoffice.org/2000/help"/>For example, if you want to apply different colors to different temperature data, enter:</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="114" xmlns:help="http://openoffice.org/2000/help"/>All temperatures below zero are blue, temperatures between 0 and 30 ┬░ C are black, and temperatures greater than 30 ┬░C are red.</p>
<p class="Head3"><help:paragraphinfo state="U" number="90" xmlns:help="http://openoffice.org/2000/help"/>Positive and Negative Numbers</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="91" xmlns:help="http://openoffice.org/2000/help"/>To define a number format that adds a different text to a number depending on if the number is positive, negative, or equal to zero, use the following format:</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="84" xmlns:help="http://openoffice.org/2000/help"/>To display numbers as percentages, (numbers that are multiplied by 100) add the percent sign (%) to the number format.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="85" xmlns:help="http://openoffice.org/2000/help"/>Scientific notation lets you write very large numbers or very small fractions in a compact form. For example, in scientific notation, 650000 is written as 6.5 x 10^5, and 0.000065 as 6.5 x 10^-5. In <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname>, these numbers are written as 6.5E+5 and 6.5E-5, respectively. To create a number format that displays numbers using scientific notation, enter a # or 0, and then one of the following codes E-, E+, e- or e+.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="99" xmlns:help="http://openoffice.org/2000/help"/>The default currency format for the cells in your spreadsheet is determined by the regional setting of your operating system. If you want, you can apply a custom currency symbol to a cell. For example, enter #.##0.00 Γé¼ to display 4.50 Γé¼ (Euros).</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="167" xmlns:help="http://openoffice.org/2000/help"/>You can also specify the locale setting for the currency by entering the locale code for the country after the symbol. For example, [$Γé¼-407] represents Euros in Germany. To view the locale code for a country, select the country in the <span class="T1">Language</span> list on the <span class="T1">Numbers</span> tab of the <span class="T1">Format Cells</span> dialog.</p>
<p class="Head2"><help:paragraphinfo state="U" number="238" xmlns:help="http://openoffice.org/2000/help"/>Date and Time Formats</p>
<p class="Head3"><help:paragraphinfo state="U" number="37" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="date formats" tag="kw65744_8" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="formats; date formats" tag="kw65744_7" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="numbers; date formats" tag="kw65744_6" xmlns:help="http://openoffice.org/2000/help"/>Date Formats</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="38" xmlns:help="http://openoffice.org/2000/help"/>To display days, months and years, use the following number format codes.</p>
<p class="TextInTable"><help:paragraphinfo state="U" number="55" xmlns:help="http://openoffice.org/2000/help"/>Day followed by comma, as in "Sunday,"</p>
<p class="TextInTable"><help:paragraphinfo state="U" number="104" xmlns:help="http://openoffice.org/2000/help"/>Q (K in Swedish locales, T in French and Spain locales)</p>
<p class="TextInTable"><help:paragraphinfo state="U" number="120" xmlns:help="http://openoffice.org/2000/help"/>Era on the Japanese Gengou calendar, single character (possible values are: M, D, S, H)</p>
<p class="TextInTable"><help:paragraphinfo state="U" number="126" xmlns:help="http://openoffice.org/2000/help"/>Number of the year within an era, without a leading zero for single-digit years</p>
<p class="TextInTable"><help:paragraphinfo state="U" number="128" xmlns:help="http://openoffice.org/2000/help"/>Number of the year within an era, with a leading zero for single-digit years</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="228" xmlns:help="http://openoffice.org/2000/help"/>To enter a date in a cell, use the Gregorian calendar format. For example, in an English locale, enter <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>1/2/2002 for Jan 2, 2002.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="137" xmlns:help="http://openoffice.org/2000/help"/>All date formats are dependent on the locale that is set in <span class="T1">Tools - Options - Language settings - Languages</span>. For example, if your locale is set to 'Japanese', then the Gengou calendar is used. The default date format in <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> uses the Gregorian Calendar.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="216" xmlns:help="http://openoffice.org/2000/help"/>To specify a calendar format that is independent of the locale, add a modifier in front of the date format. For example, to display a date using the Jewish calendar format in a non-Hebrew locale, enter: [~jewish]DD/MM/YYYY.</p>
<p class="TextInTable"><help:paragraphinfo state="U" number="223" xmlns:help="http://openoffice.org/2000/help"/>Arabic Islamic Calendar, currently supported for the following locales: ar_EG, ar_LB, ar_SA, and ar_TN</p>
<p class="TextInTable"><help:paragraphinfo state="U" number="226" xmlns:help="http://openoffice.org/2000/help"/>Republic Of China Calendar</p>
</span></td></tr></table>
<p class="Paragraph"><help:paragraphinfo state="U" number="140" xmlns:help="http://openoffice.org/2000/help"/><help:switch select="Program" xmlns:help="http://openoffice.org/2000/help"><help:case select="CALC">If you perform a calculation that involves one or more cells using a date format, the result is formatted according to the following mappings:</help:case></help:switch></p>
<p class="Paragraph"><help:paragraphinfo state="U" number="163" xmlns:help="http://openoffice.org/2000/help"/><help:switch select="Program" xmlns:help="http://openoffice.org/2000/help"><help:case select="CALC">The Date&Time format displays the date and time that an entry was made to a cell with this format.</help:case></help:switch></p>
<p class="Paragraph"><help:paragraphinfo state="U" number="164" xmlns:help="http://openoffice.org/2000/help"/><help:switch select="Program" xmlns:help="http://openoffice.org/2000/help"><help:case select="CALC">In <help:productname>%PRODUCTNAME</help:productname>, a date with the value "0" corresponds to Dec 30, 1899.</help:case></help:switch></p>
<p class="Paragraph"><help:paragraphinfo state="U" number="62" xmlns:help="http://openoffice.org/2000/help"/>To display hours, minutes and seconds use the following number format codes.</p>
<p class="TextInTable"><help:paragraphinfo state="U" number="77" xmlns:help="http://openoffice.org/2000/help"/>To display seconds as fractions, add a decimal delimiter to your number format code. For example, enter <span class="T1">hh:mm:ss,00</span> to display the time as "01:02:03,45".</p>
</span></th></tr></table>
<p class="Paragraph"><help:paragraphinfo state="U" number="102" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="time formats; over 24 hours" tag="kw65744_2" xmlns:help="http://openoffice.org/2000/help"/>If a time is entered in the form 02:03,45 or 01:02:03,45 or 25:01:02, the following formats are assigned if no other time format has been specified: MM:SS,00 or [HH]:MM:SS,00 or [HH]:MM:SS.</p>
<p class="Head2"><help:paragraphinfo state="U" number="169" xmlns:help="http://openoffice.org/2000/help"/>Displaying Numbers Using Native Characters</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="170" xmlns:help="http://openoffice.org/2000/help"/>To display numbers using native number characters, use a [NatNum1], [NatNum2], ... [NatNum11] modifier at the beginning of a number format codes.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="171" xmlns:help="http://openoffice.org/2000/help"/>The [NatNum1] modifier always uses a one to one character mapping to convert numbers to a string that matches the native number format code of the corresponding locale. The other modifiers produce different results if they are used with different locales. A locale can be the language and the territory for which the format code is defined, or a modifier such as [$-yyy] that follows the native number modifier. In this case, yyy is the hexadecimal MS-LCID that is also used in currency format codes. For example, to display a number using Japanese short Kanji characters in an English US locale, use the following number format code:</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="173" xmlns:help="http://openoffice.org/2000/help"/>In the following list, the Microsoft Excel [DBNumX] modifier that corresponds to <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> [NatNum] modifier is shown. If you want, you can use a [DBNumX] modifier instead of [NatNum] modifier for your locale. Whenever possible, <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> internally maps [DBNumX] modifiers to <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>[NatNumN] modifiers.</p>
<p class="PropText"><help:paragraphinfo state="U" number="190" xmlns:help="http://openoffice.org/2000/help"/>Chinese: lower case text [DBNum1]</p>
<p class="PropText"><help:paragraphinfo state="U" number="191" xmlns:help="http://openoffice.org/2000/help"/>Japanese: modern long Kanji text [DBNum2]</p>
<p class="PropText"><help:paragraphinfo state="U" number="192" xmlns:help="http://openoffice.org/2000/help"/>Korean: formal lower case text</p>
<p class="PropText"><help:paragraphinfo state="U" number="194" xmlns:help="http://openoffice.org/2000/help"/>Chinese: Chinese upper case text [DBNum2]</p>
<p class="PropText"><help:paragraphinfo state="U" number="195" xmlns:help="http://openoffice.org/2000/help"/>Japanese: traditional long Kanji text [DBNum3]</p>
<p class="PropText"><help:paragraphinfo state="U" number="196" xmlns:help="http://openoffice.org/2000/help"/>Korean: formal upper case text</p>
<p class="PropText"><help:paragraphinfo state="U" number="205" xmlns:help="http://openoffice.org/2000/help"/>Japanese: traditional short Kanji text [DBNum4]</p>
<p class="PropText"><help:paragraphinfo state="U" number="206" xmlns:help="http://openoffice.org/2000/help"/>Korean: informal upper case text</p>